package com.henry.chatkit.messages

import android.graphics.drawable.Drawable
import com.blankj.utilcode.util.ScreenUtils
import com.henry.chatkit.R
import com.henry.chatkit.utils.SizeUtils

class MessageProperties {

    companion object {

        private var sp: MessageProperties? = null

        fun getInstance() : MessageProperties {
            if (sp == null) {
                sp = MessageProperties()
            }
            return sp as MessageProperties
        }
    }

    val avatarId = R.drawable.avatar
    val avatarRadius = 5
    val avatarSize = listOf(SizeUtils.dp2px(40), SizeUtils.dp2px(40))
    val nameFontSize = 0
    val nameFontColor = 0
    val leftNameVisibility = 0
    val rightNameVisibility = 0
    val chatContextFontSize = 0
    val rightChatContentFontColor = 0
    val rightBubble: Drawable? = null
    val leftChatContentFontColor = 0
    val leftBubble: Drawable? = null
    val tipsMessageFontSize = 0
    val tipsMessageFontColor = 0
    val tipsMessageBubble: Drawable? = null
    val chatTimeFontSize = 0
    val chatTimeFontColor = 0
    val chatTimeBubble: Drawable? = null

    // px
    val textMaxWidth = ScreenUtils.getScreenWidth() / 10 * 7

    // dp
    val imageRadius = 5
    var imageMaxSize = SizeUtils.px2dp(ScreenUtils.getScreenWidth() / 3)
    var imageMinSize = 40

    val audioMaxDuration = 60
    val audioMaxWidth = ScreenUtils.getScreenWidth() / 10 * 7
    val audioMinWidth = SizeUtils.dp2px(50)
    val audioMargin = (textMaxWidth - audioMinWidth) / audioMaxDuration

}